<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/3/2
  Time: 18:39
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="../../../base.jsp" %>
<div class="container-fluid">
    <!--右边内容显示  功能显示-->
    <h3 class="text-primary">卡牌发布</h3>
    <div id="cardArea">
        <ul class="nav nav-tabs">
            <%--<li role="presentation" class="active"><a href="javascript:;">健康</a></li>--%>
            <c:forEach items="${growthList}" var="growth" varStatus="vs">
                <li growthId="${growth.growthId}" role="presentation"
                    class="growth
                    <c:choose>
                        <c:when test="${empty growthId}"><c:if test="${vs.count == 1}">active</c:if></c:when>
                    <c:otherwise>
                            <c:if test="${growth.growthId == growthId}">active</c:if>
                        </c:otherwise>
                    </c:choose>
                    ">
                        <%--<c:if test="${paperVo.paper.status != 50}"> text-danger</c:if>--%>
                    <a href="javascript:;" growthId="${growth.growthId}"
                       class="growth <c:if test="${growth.status != 50}"> text-danger</c:if>">${growth.name}
                        <button class="glyphicon glyphicon-pencil editGrowthBtn" value="修改"
                                onclick="card.editGrowth('${growth.growthId}')"/>
                    </a>

                </li>
            </c:forEach>
            <li role="presentation"><a href="javascript:;" class="editGrowthBtn"
                                       onclick="card.editGrowth()"><span
                    class="glyphicon glyphicon-plus"></span></a></li>
        </ul>
    </div>
    <div class="content_card">
        <%--<a href="javascript:;" class="text-info"><span class="glyphicon glyphicon-modal-window"></span>健康002</a>--%>
        <%--<a href="javascript:;" class="text-info text-danger"><span class="glyphicon glyphicon-modal-window"></span>健康002</a>--%>
        <%--<a href="javascript:;" class="text-info"><span class="glyphicon glyphicon-modal-window"></span>健康002</a>--%>
        <%--<a href="javascript:;" class="text-info"><span class="glyphicon glyphicon-modal-window"></span>健康002</a>--%>
        <%--<a href="javascript:;" class="text-info"><span class="glyphicon glyphicon-modal-window"></span>健康002</a>--%>
        <c:forEach items="${paperVoList}" var="paperVo">
            <a paperId="${paperVo.paper.paperId}" paperCardId="${paperVo.paperCard.paperCardId}"
               growthId="${paperVo.paper.growthId}" href="javascript:;"
               class="paper text-info<c:if test="${paperVo.paper.status != 50}"> text-danger</c:if>">
                <span class="glyphicon glyphicon-modal-window"></span>${paperVo.paperCard.name}
                <c:if test="${empty paperVo.paperCard.name}">(有试卷，无卡片)</c:if>
            </a>
        </c:forEach>
        <button class="btn btn-primary paper" type="button" id="addCard" growthId="${paperVoList[0].paper.growthId}">
            添加(试卷)卡牌
        </button>
    </div>
    <div class="info_user clearfix">
        <span class="pull-left">备注：</span>
        <p class="pull-left"><span class="glyphicon glyphicon-modal-window"></span>已发布</p>
        <p class="pull-left text-danger"><span class="glyphicon glyphicon-modal-window"></span>未发布</p>
    </div>
</div>

<script>
    $("a.growth").on("click", function () {
        var url = base.basePath +"page/card/card.cgi?growthId=" + $(this).attr("growthId");
        index_js.loadRightPage(url);
    });
    $("a.paper").on("click", function () {
        var url = base.basePath + "/page/card/editCard.cgi?paperCardId=" + $(this).attr("paperCardId") + "&growthId=" + $(this).attr("growthId") + "&paperId=" + $(this).attr("paperId");
        index_js.loadRightPage(url);
    });
    $("button.paper").on("click", function () {
        var url = base.basePath + "/page/card/editCard.cgi?growthId=" + $(this).attr("growthId");
        index_js.loadRightPage(url);
    });
</script>
<script src="${basePath}js/card_js/card.js"></script>